import java.util.Stack;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-04-12
 * Time:9:45
 */
public class Text {
    public static void main(String[] args) {
        String a = "{}()[]";
        char[] kk = a.toCharArray();
        Stack fw = new Stack();
        for (char t : kk) {
            fw.push(t);
        }
        for(int i= kk.length-1;i>=0;i-=2)
        {
            if(kk[i]==']')
            {
                fw.pop();
                if(!fw.peek().equals('['))
                {
                    System.out.println("错误");
                    break;
                }
                fw.pop();
            }
            if(kk[i]=='}')
            {
                fw.pop();
                if(!fw.peek().equals('{'))
                {
                    System.out.println("错误");
                    break;
                }
                fw.pop();
            }
            if(kk[i]==')')
            {
                fw.pop();
                if(!fw.peek().equals('('))
                {
                System.out.println("错误");
                break;
                 }
                fw.pop();
           }
        }
        System.out.println("nice");

    }
}
